
/*
 * Copyright 2002-2022 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2022原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.beans.factory;

import java.lang.annotation.Annotation;
import java.util.Map;
import java.util.Set;

import org.springframework.beans.BeansException;
import org.springframework.core.ResolvableType;
import org.springframework.lang.Nullable;

/**
 * Extension of the {@link BeanFactory} interface to be implemented by bean factories
 * that can enumerate all their bean instances, rather than attempting bean lookup
 * by name one by one as requested by clients. BeanFactory implementations that
 * preload all their bean definitions (such as XML-based factories) may implement
 * this interface.
 *
 * <p>If this is a {@link HierarchicalBeanFactory}, the return values will <i>not</i>
 * take any BeanFactory hierarchy into account, but will relate only to the beans
 * defined in the current factory. Use the {@link BeanFactoryUtils} helper class
 * to consider beans in ancestor factories too.
 *
 * <p>The methods in this interface will just respect bean definitions of this factory.
 * They will ignore any singleton beans that have been registered by other means like
 * {@link org.springframework.beans.factory.config.ConfigurableBeanFactory}'s
 * {@code registerSingleton} method, with the exception of
 * {@code getBeanNamesForType} and {@code getBeansOfType} which will check
 * such manually registered singletons too. Of course, BeanFactory's {@code getBean}
 * does allow transparent access to such special beans as well. However, in typical
 * scenarios, all beans will be defined by external bean definitions anyway, so most
 * applications don't need to worry about this differentiation.
 *
 * <p><b>NOTE:</b> With the exception of {@code getBeanDefinitionCount}
 * and {@code containsBeanDefinition}, the methods in this interface
 * are not designed for frequent invocation. Implementations may be slow.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @since 16 April 2001
 * @see HierarchicalBeanFactory
 * @see BeanFactoryUtils
 */
/**
 *将由bean工厂实现的｛@link BeanFactory｝接口的扩展
 *可以枚举其所有bean实例，而不是尝试bean查找
 *根据客户的要求，逐一点名。BeanFactory实现
 *预加载它们的所有bean定义（例如基于XML的工厂）
 *此界面。
 *
 *＜p＞如果这是一个｛@link HierarchicalBeanFactory｝，则返回值将＜i＞而不是＜/i＞
 *考虑任何BeanFactory层次结构，但只与bean相关
 *在当前工厂中定义。使用｛@link BeanFactoryUtils｝帮助程序类
 *也可以考虑祖先工厂的豆子。
 *
 *＜p＞此接口中的方法将仅遵守此工厂的bean定义。
 *它们将忽略通过其他方式注册的任何单例bean，如
 *｛@link org.springframework.beans.factory.config.ConfigableBeanFactory｝的
 *｛@code registerSingleton｝方法，除了
 *｛@code getBeanNameForType｝和｛@codegetBeanOfType｝将检查
 *这类手动登记的单身者也是如此。当然，BeanFactory的｛@code getBean｝
 *也允许透明访问这种特殊的bean。然而，在典型情况下
 *无论如何，所有bean都将由外部bean定义定义，因此大多数
 *应用程序不需要担心这种差异。
 *
 *<p><b>注意：</b>除了｛@code getBeanDefinitionCount｝
 *和｛@code containsBeanDefinition｝，此接口中的方法
 *不是为频繁调用而设计的。实施可能很慢。
 *
 *@作者Rod Johnson
 *@作者Juergen Hoeller
 *@自2001年4月16日起
 *@参见HierarchicalBeanFactory
 *@参见BeanFactoryUtils
 */
public interface ListableBeanFactory extends BeanFactory {

	/**
	 * Check if this bean factory contains a bean definition with the given name.
	 * <p>Does not consider any hierarchy this factory may participate in,
	 * and ignores any singleton beans that have been registered by
	 * other means than bean definitions.
	 * @param beanName the name of the bean to look for
	 * @return if this bean factory contains a bean definition with the given name
	 * @see #containsBean
	 */
	/**
	 *检查此bean工厂是否包含具有给定名称的bean定义。
	 *＜p＞不考虑该工厂可能参与的任何层次结构，
	 *并忽略已由注册的任何单例bean
	 *除了bean定义之外的其他方式。
	 *@param beanName要查找的bean的名称
	 *@return如果此bean工厂包含具有给定名称的bean定义
	 *@参见#containsBean
	 */
	boolean containsBeanDefinition(String beanName);

	/**
	 * Return the number of beans defined in the factory.
	 * <p>Does not consider any hierarchy this factory may participate in,
	 * and ignores any singleton beans that have been registered by
	 * other means than bean definitions.
	 * @return the number of beans defined in the factory
	 */
	/**
	 *返回工厂中定义的bean数。
	 *＜p＞不考虑该工厂可能参与的任何层次结构，
	 *并忽略已由注册的任何单例bean
	 *除了bean定义之外的其他方式。
	 *@返回工厂中定义的bean数
	 */
	int getBeanDefinitionCount();

	/**
	 * Return the names of all beans defined in this factory.
	 * <p>Does not consider any hierarchy this factory may participate in,
	 * and ignores any singleton beans that have been registered by
	 * other means than bean definitions.
	 * @return the names of all beans defined in this factory,
	 * or an empty array if none defined
	 */
	/**
	 *返回此工厂中定义的所有bean的名称。
	 *＜p＞不考虑该工厂可能参与的任何层次结构，
	 *并忽略已由注册的任何单例bean
	 *除了bean定义之外的其他方式。
	 *@return此工厂中定义的所有bean的名称，
	 *或空数组（如果未定义）
	 */
	String[] getBeanDefinitionNames();

	/**
	 * Return a provider for the specified bean, allowing for lazy on-demand retrieval
	 * of instances, including availability and uniqueness options.
	 * @param requiredType type the bean must match; can be an interface or superclass
	 * @param allowEagerInit whether stream-based access may initialize <i>lazy-init
	 * singletons</i> and <i>objects created by FactoryBeans</i> (or by factory methods
	 * with a "factory-bean" reference) for the type check
	 * @return a corresponding provider handle
	 * @since 5.3
	 * @see #getBeanProvider(ResolvableType, boolean)
	 * @see #getBeanProvider(Class)
	 * @see #getBeansOfType(Class, boolean, boolean)
	 * @see #getBeanNamesForType(Class, boolean, boolean)
	 */
	/**
	 *返回指定bean的提供程序，允许延迟按需检索
	 *实例，包括可用性和唯一性选项。
	 *@param requiredType bean必须匹配的类型；可以是接口或超类
	 *@param allowEagleInit基于流的访问是否可以初始化＜i＞惰性初始化
	 *由FactoryBeans</i>（或通过工厂方法）创建的singleton</i>和<i>对象
	 *带有“factorybean”引用）进行类型检查
	 *@返回相应的提供程序句柄
	 *@自5.3
	 *@参见#getBeanProvider（ResolutibleType，布尔值）
	 *@参见#getBeanProvider（类）
	 *@see#getBeansOfType（类、布尔值、布尔值）
	 *@see#getBeanNameForType（类，布尔值，布尔值）
	 */
	<T> ObjectProvider<T> getBeanProvider(Class<T> requiredType, boolean allowEagerInit);

	/**
	 * Return a provider for the specified bean, allowing for lazy on-demand retrieval
	 * of instances, including availability and uniqueness options.
	 * @param requiredType type the bean must match; can be a generic type declaration.
	 * Note that collection types are not supported here, in contrast to reflective
	 * injection points. For programmatically retrieving a list of beans matching a
	 * specific type, specify the actual bean type as an argument here and subsequently
	 * use {@link ObjectProvider#orderedStream()} or its lazy streaming/iteration options.
	 * @param allowEagerInit whether stream-based access may initialize <i>lazy-init
	 * singletons</i> and <i>objects created by FactoryBeans</i> (or by factory methods
	 * with a "factory-bean" reference) for the type check
	 * @return a corresponding provider handle
	 * @since 5.3
	 * @see #getBeanProvider(ResolvableType)
	 * @see ObjectProvider#iterator()
	 * @see ObjectProvider#stream()
	 * @see ObjectProvider#orderedStream()
	 * @see #getBeanNamesForType(ResolvableType, boolean, boolean)
	 */
	/**
	 *返回指定bean的提供程序，允许延迟按需检索
	 *实例，包括可用性和唯一性选项。
	 *@param requiredType bean必须匹配的类型；可以是泛型类型声明。
	 *请注意，这里不支持集合类型，而不是反射类型
	 *注入点。用于以编程方式检索与
	 *具体类型，在此处指定实际的bean类型作为参数，然后
	 *使用｛@link ObjectProvider#orderedStream（）｝或其惰性流/迭代选项。
	 *@param allowEagleInit基于流的访问是否可以初始化＜i＞惰性初始化
	 *由FactoryBeans</i>（或通过工厂方法）创建的singleton</i>和<i>对象
	 *带有“factorybean”引用）进行类型检查
	 *@返回相应的提供程序句柄
	 *@自5.3
	 *@参见#getBeanProvider（可解析类型）
	 *@see ObjectProvider#迭代器（）
	 *@see ObjectProvider#stream（）
	 *@see ObjectProvider#orderedStream（）
	 *@see#getBeanNameForType（ResolutibleType，boolean，boolean）
	 */
	<T> ObjectProvider<T> getBeanProvider(ResolvableType requiredType, boolean allowEagerInit);

	/**
	 * Return the names of beans matching the given type (including subclasses),
	 * judging from either bean definitions or the value of {@code getObjectType}
	 * in the case of FactoryBeans.
	 * <p><b>NOTE: This method introspects top-level beans only.</b> It does <i>not</i>
	 * check nested beans which might match the specified type as well.
	 * <p>Does consider objects created by FactoryBeans, which means that FactoryBeans
	 * will get initialized. If the object created by the FactoryBean doesn't match,
	 * the raw FactoryBean itself will be matched against the type.
	 * <p>Does not consider any hierarchy this factory may participate in.
	 * Use BeanFactoryUtils' {@code beanNamesForTypeIncludingAncestors}
	 * to include beans in ancestor factories too.
	 * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
	 * by other means than bean definitions.
	 * <p>This version of {@code getBeanNamesForType} matches all kinds of beans,
	 * be it singletons, prototypes, or FactoryBeans. In most implementations, the
	 * result will be the same as for {@code getBeanNamesForType(type, true, true)}.
	 * <p>Bean names returned by this method should always return bean names <i>in the
	 * order of definition</i> in the backend configuration, as far as possible.
	 * @param type the generically typed class or interface to match
	 * @return the names of beans (or objects created by FactoryBeans) matching
	 * the given object type (including subclasses), or an empty array if none
	 * @since 4.2
	 * @see #isTypeMatch(String, ResolvableType)
	 * @see FactoryBean#getObjectType
	 * @see BeanFactoryUtils#beanNamesForTypeIncludingAncestors(ListableBeanFactory, ResolvableType)
	 */
	/**
	 *返回与给定类型（包括子类）匹配的bean的名称，
	 *根据bean定义或｛@code getObjectType｝的值判断
	 *在FactoryBean的情况下。
	 *＜p＞＜b＞注意：此方法仅内省顶级bean</b> 它不是</i>而是</i>
	 *检查可能与指定类型匹配的嵌套bean。
	 *＜p＞考虑FactoryBean创建的对象，这意味着FactoryBean
	 *将被初始化。如果FactoryBean创建的对象不匹配，
	 *原始FactoryBean本身将与类型匹配。
	 *＜p＞不考虑该工厂可能参与的任何层次结构。
	 *使用BeanFactoryUtils‘｛@code beanNamesForTypeIncludeingAncestors｝
	 *将豆类也纳入祖先工厂。
	 *＜p＞注意：＜i＞是否＜/i＞忽略已注册的单例bean
	 *通过bean定义以外的其他方式。
	 *＜p＞这个版本的｛@code getBeanNameForType｝匹配所有类型的bean，
	 *无论是单件、原型还是FactoryBean。在大多数实现中
	 *结果将与｛@code getBeanNameForType（type，true，true）｝相同。
	 *＜p＞此方法返回的Bean名称应始终在
	 *尽可能在后端配置中定义</i>的顺序。
	 *@param键入要匹配的泛型类型的类或接口
	 *@return匹配的bean（或FactoryBean创建的对象）的名称
	 *给定的对象类型（包括子类），如果没有，则为空数组
	 *@自4.2
	 *@参见#isTypeMatch（字符串，可解析类型）
	 *@参见FactoryBean#getObjectType
	 *@see BeanFactory Utils#beanNamesForTypeInclusingAncestors（ListableBeanFactory，ResolutibleType）
	 */
	String[] getBeanNamesForType(ResolvableType type);

	/**
	 * Return the names of beans matching the given type (including subclasses),
	 * judging from either bean definitions or the value of {@code getObjectType}
	 * in the case of FactoryBeans.
	 * <p><b>NOTE: This method introspects top-level beans only.</b> It does <i>not</i>
	 * check nested beans which might match the specified type as well.
	 * <p>Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set,
	 * which means that FactoryBeans will get initialized. If the object created by the
	 * FactoryBean doesn't match, the raw FactoryBean itself will be matched against the
	 * type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked
	 * (which doesn't require initialization of each FactoryBean).
	 * <p>Does not consider any hierarchy this factory may participate in.
	 * Use BeanFactoryUtils' {@code beanNamesForTypeIncludingAncestors}
	 * to include beans in ancestor factories too.
	 * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
	 * by other means than bean definitions.
	 * <p>Bean names returned by this method should always return bean names <i>in the
	 * order of definition</i> in the backend configuration, as far as possible.
	 * @param type the generically typed class or interface to match
	 * @param includeNonSingletons whether to include prototype or scoped beans too
	 * or just singletons (also applies to FactoryBeans)
	 * @param allowEagerInit whether to initialize <i>lazy-init singletons</i> and
	 * <i>objects created by FactoryBeans</i> (or by factory methods with a
	 * "factory-bean" reference) for the type check. Note that FactoryBeans need to be
	 * eagerly initialized to determine their type: So be aware that passing in "true"
	 * for this flag will initialize FactoryBeans and "factory-bean" references.
	 * @return the names of beans (or objects created by FactoryBeans) matching
	 * the given object type (including subclasses), or an empty array if none
	 * @since 5.2
	 * @see FactoryBean#getObjectType
	 * @see BeanFactoryUtils#beanNamesForTypeIncludingAncestors(ListableBeanFactory, ResolvableType, boolean, boolean)
	 */
	/**
	 *返回与给定类型（包括子类）匹配的bean的名称，
	 *根据bean定义或｛@code getObjectType｝的值判断
	 *在FactoryBean的情况下。
	 *＜p＞＜b＞注意：此方法仅内省顶级bean</b> 它不是</i>而是</i>
	 *检查可能与指定类型匹配的嵌套bean。
	 *＜p＞如果设置了“allowEagleInit”标志，则考虑FactoryBean创建的对象，
	 *这意味着FactoryBean将被初始化。如果由
	 *FactoryBean不匹配，原始FactoryBean本身将与
	 *类型。如果未设置“allowEagleInit”，则只检查原始FactoryBean
	 *（这不需要初始化每个FactoryBean）。
	 *＜p＞不考虑该工厂可能参与的任何层次结构。
	 *使用BeanFactoryUtils‘｛@code beanNamesForTypeIncludeingAncestors｝
	 *将豆类也纳入祖先工厂。
	 *＜p＞注意：＜i＞是否＜/i＞忽略已注册的单例bean
	 *通过bean定义以外的其他方式。
	 *＜p＞此方法返回的Bean名称应始终在
	 *尽可能在后端配置中定义</i>的顺序。
	 *@param键入要匹配的泛型类型的类或接口
	 *@param includeOnSingleton是否也包括原型或作用域bean
	 *或者仅仅是单体（也适用于FactoryBean）
	 *@param allowEagleInit是否初始化＜i＞lazy init singletons＜/i＞和
	 *<i>由FactoryBeans</i>创建的对象（或由带有
	 *“factorybean”引用）。注意FactoryBean需要
	 *急切地初始化以确定它们的类型：所以请注意传入“true”
	 *for此标志将初始化FactoryBean和“factorybean”引用。
	 *@return匹配的bean（或FactoryBean创建的对象）的名称
	 *给定的对象类型（包括子类），如果没有，则为空数组
	 *@自5.2
	 *@参见FactoryBean#getObjectType
	 *@see BeanFactory Utils#beanNamesForTypeIncludedingAncestors（ListableBeanFactory，ResolutibleType，boolean，boolean）
	 */
	String[] getBeanNamesForType(ResolvableType type, boolean includeNonSingletons, boolean allowEagerInit);

	/**
	 * Return the names of beans matching the given type (including subclasses),
	 * judging from either bean definitions or the value of {@code getObjectType}
	 * in the case of FactoryBeans.
	 * <p><b>NOTE: This method introspects top-level beans only.</b> It does <i>not</i>
	 * check nested beans which might match the specified type as well.
	 * <p>Does consider objects created by FactoryBeans, which means that FactoryBeans
	 * will get initialized. If the object created by the FactoryBean doesn't match,
	 * the raw FactoryBean itself will be matched against the type.
	 * <p>Does not consider any hierarchy this factory may participate in.
	 * Use BeanFactoryUtils' {@code beanNamesForTypeIncludingAncestors}
	 * to include beans in ancestor factories too.
	 * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
	 * by other means than bean definitions.
	 * <p>This version of {@code getBeanNamesForType} matches all kinds of beans,
	 * be it singletons, prototypes, or FactoryBeans. In most implementations, the
	 * result will be the same as for {@code getBeanNamesForType(type, true, true)}.
	 * <p>Bean names returned by this method should always return bean names <i>in the
	 * order of definition</i> in the backend configuration, as far as possible.
	 * @param type the class or interface to match, or {@code null} for all bean names
	 * @return the names of beans (or objects created by FactoryBeans) matching
	 * the given object type (including subclasses), or an empty array if none
	 * @see FactoryBean#getObjectType
	 * @see BeanFactoryUtils#beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class)
	 */
	/**
	 *返回与给定类型（包括子类）匹配的bean的名称，
	 *根据bean定义或｛@code getObjectType｝的值判断
	 *在FactoryBean的情况下。
	 *＜p＞＜b＞注意：此方法仅内省顶级bean</b> 它不是</i>而是</i>
	 *检查可能与指定类型匹配的嵌套bean。
	 *＜p＞考虑FactoryBean创建的对象，这意味着FactoryBean
	 *将被初始化。如果FactoryBean创建的对象不匹配，
	 *原始FactoryBean本身将与类型匹配。
	 *＜p＞不考虑该工厂可能参与的任何层次结构。
	 *使用BeanFactoryUtils‘｛@code beanNamesForTypeIncludeingAncestors｝
	 *将豆类也纳入祖先工厂。
	 *＜p＞注意：＜i＞是否＜/i＞忽略已注册的单例bean
	 *通过bean定义以外的其他方式。
	 *＜p＞这个版本的｛@code getBeanNameForType｝匹配所有类型的bean，
	 *无论是单件、原型还是FactoryBean。在大多数实现中
	 *结果将与｛@code getBeanNameForType（type，true，true）｝相同。
	 *＜p＞此方法返回的Bean名称应始终在
	 *尽可能在后端配置中定义</i>的顺序。
	 *@param键入要匹配的类或接口，或者｛@code null｝用于所有bean名称
	 *@return匹配的bean（或FactoryBean创建的对象）的名称
	 *给定的对象类型（包括子类），如果没有，则为空数组
	 *@参见FactoryBean#getObjectType
	 *@see BeanFactory Utils#beanNamesForTypeIncludedingAncestors（ListableBeanFactory，类）
	 */
	String[] getBeanNamesForType(@Nullable Class<?> type);

	/**
	 * Return the names of beans matching the given type (including subclasses),
	 * judging from either bean definitions or the value of {@code getObjectType}
	 * in the case of FactoryBeans.
	 * <p><b>NOTE: This method introspects top-level beans only.</b> It does <i>not</i>
	 * check nested beans which might match the specified type as well.
	 * <p>Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set,
	 * which means that FactoryBeans will get initialized. If the object created by the
	 * FactoryBean doesn't match, the raw FactoryBean itself will be matched against the
	 * type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked
	 * (which doesn't require initialization of each FactoryBean).
	 * <p>Does not consider any hierarchy this factory may participate in.
	 * Use BeanFactoryUtils' {@code beanNamesForTypeIncludingAncestors}
	 * to include beans in ancestor factories too.
	 * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
	 * by other means than bean definitions.
	 * <p>Bean names returned by this method should always return bean names <i>in the
	 * order of definition</i> in the backend configuration, as far as possible.
	 * @param type the class or interface to match, or {@code null} for all bean names
	 * @param includeNonSingletons whether to include prototype or scoped beans too
	 * or just singletons (also applies to FactoryBeans)
	 * @param allowEagerInit whether to initialize <i>lazy-init singletons</i> and
	 * <i>objects created by FactoryBeans</i> (or by factory methods with a
	 * "factory-bean" reference) for the type check. Note that FactoryBeans need to be
	 * eagerly initialized to determine their type: So be aware that passing in "true"
	 * for this flag will initialize FactoryBeans and "factory-bean" references.
	 * @return the names of beans (or objects created by FactoryBeans) matching
	 * the given object type (including subclasses), or an empty array if none
	 * @see FactoryBean#getObjectType
	 * @see BeanFactoryUtils#beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)
	 */
	/**
	 *返回与给定类型（包括子类）匹配的bean的名称，
	 *根据bean定义或｛@code getObjectType｝的值判断
	 *在FactoryBean的情况下。
	 *＜p＞＜b＞注意：此方法仅内省顶级bean</b> 它不是</i>而是</i>
	 *检查可能与指定类型匹配的嵌套bean。
	 *＜p＞如果设置了“allowEagleInit”标志，则考虑FactoryBean创建的对象，
	 *这意味着FactoryBean将被初始化。如果由
	 *FactoryBean不匹配，原始FactoryBean本身将与
	 *类型。如果未设置“allowEagleInit”，则只检查原始FactoryBean
	 *（这不需要初始化每个FactoryBean）。
	 *＜p＞不考虑该工厂可能参与的任何层次结构。
	 *使用BeanFactoryUtils‘｛@code beanNamesForTypeIncludeingAncestors｝
	 *将豆类也纳入祖先工厂。
	 *＜p＞注意：＜i＞是否＜/i＞忽略已注册的单例bean
	 *通过bean定义以外的其他方式。
	 *＜p＞此方法返回的Bean名称应始终在
	 *尽可能在后端配置中定义</i>的顺序。
	 *@param键入要匹配的类或接口，或者｛@code null｝用于所有bean名称
	 *@param includeOnSingleton是否也包括原型或作用域bean
	 *或者仅仅是单体（也适用于FactoryBean）
	 *@param allowEagleInit是否初始化＜i＞lazy init singletons＜/i＞和
	 *<i>由FactoryBeans</i>创建的对象（或由带有
	 *“factorybean”引用）。注意FactoryBean需要
	 *急切地初始化以确定它们的类型：所以请注意传入“true”
	 *for此标志将初始化FactoryBean和“factorybean”引用。
	 *@return匹配的bean（或FactoryBean创建的对象）的名称
	 *给定的对象类型（包括子类），如果没有，则为空数组
	 *@参见FactoryBean#getObjectType
	 *@see BeanFactory Utils#beanNamesForTypeIncludedingAncestors（ListableBeanFactory，Class，boolean，boolean）
	 */
	String[] getBeanNamesForType(@Nullable Class<?> type, boolean includeNonSingletons, boolean allowEagerInit);

	/**
	 * Return the bean instances that match the given object type (including
	 * subclasses), judging from either bean definitions or the value of
	 * {@code getObjectType} in the case of FactoryBeans.
	 * <p><b>NOTE: This method introspects top-level beans only.</b> It does <i>not</i>
	 * check nested beans which might match the specified type as well.
	 * <p>Does consider objects created by FactoryBeans, which means that FactoryBeans
	 * will get initialized. If the object created by the FactoryBean doesn't match,
	 * the raw FactoryBean itself will be matched against the type.
	 * <p>Does not consider any hierarchy this factory may participate in.
	 * Use BeanFactoryUtils' {@code beansOfTypeIncludingAncestors}
	 * to include beans in ancestor factories too.
	 * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
	 * by other means than bean definitions.
	 * <p>This version of getBeansOfType matches all kinds of beans, be it
	 * singletons, prototypes, or FactoryBeans. In most implementations, the
	 * result will be the same as for {@code getBeansOfType(type, true, true)}.
	 * <p>The Map returned by this method should always return bean names and
	 * corresponding bean instances <i>in the order of definition</i> in the
	 * backend configuration, as far as possible.
	 * @param type the class or interface to match, or {@code null} for all concrete beans
	 * @return a Map with the matching beans, containing the bean names as
	 * keys and the corresponding bean instances as values
	 * @throws BeansException if a bean could not be created
	 * @since 1.1.2
	 * @see FactoryBean#getObjectType
	 * @see BeanFactoryUtils#beansOfTypeIncludingAncestors(ListableBeanFactory, Class)
	 */
	/**
	 *返回与给定对象类型匹配的bean实例（包括
	 *子类），从bean定义或
	 *在FactoryBean的情况下，｛@code getObjectType｝。
	 *＜p＞＜b＞注意：此方法仅内省顶级bean</b> 它不是</i>而是</i>
	 *检查可能与指定类型匹配的嵌套bean。
	 *＜p＞考虑FactoryBean创建的对象，这意味着FactoryBean
	 *将被初始化。如果FactoryBean创建的对象不匹配，
	 *原始FactoryBean本身将与类型匹配。
	 *＜p＞不考虑该工厂可能参与的任何层次结构。
	 *使用BeanFactoryUtils‘｛@code beansOfTypeInclusingAncestors｝
	 *将豆类也纳入祖先工厂。
	 *＜p＞注意：＜i＞是否＜/i＞忽略已注册的单例bean
	 *通过bean定义以外的其他方式。
	 *＜p＞这个版本的getBeansOfType匹配所有类型的bean
	 *单件、原型或FactoryBean。在大多数实现中
	 *结果将与｛@code getBeansOfType（type，true，true）｝相同。
	 *＜p＞此方法返回的Map应始终返回bean名称和
	 *在
	 *后端配置。
	 *@param键入要匹配的类或接口，或者｛@code null｝用于所有具体bean
	 *@返回带有匹配bean的Map，其中包含bean名称
	 *键和相应的bean实例作为值
	 *如果无法创建bean，@throws BeansException
	 *@自1.1.2
	 *@参见FactoryBean#getObjectType
	 *@see BeanFactory Utils#beansOfTypeIncludedingAncestors（ListableBeanFactory，类）
	 */
	<T> Map<String, T> getBeansOfType(@Nullable Class<T> type) throws BeansException;

	/**
	 * Return the bean instances that match the given object type (including
	 * subclasses), judging from either bean definitions or the value of
	 * {@code getObjectType} in the case of FactoryBeans.
	 * <p><b>NOTE: This method introspects top-level beans only.</b> It does <i>not</i>
	 * check nested beans which might match the specified type as well.
	 * <p>Does consider objects created by FactoryBeans if the "allowEagerInit" flag is set,
	 * which means that FactoryBeans will get initialized. If the object created by the
	 * FactoryBean doesn't match, the raw FactoryBean itself will be matched against the
	 * type. If "allowEagerInit" is not set, only raw FactoryBeans will be checked
	 * (which doesn't require initialization of each FactoryBean).
	 * <p>Does not consider any hierarchy this factory may participate in.
	 * Use BeanFactoryUtils' {@code beansOfTypeIncludingAncestors}
	 * to include beans in ancestor factories too.
	 * <p>Note: Does <i>not</i> ignore singleton beans that have been registered
	 * by other means than bean definitions.
	 * <p>The Map returned by this method should always return bean names and
	 * corresponding bean instances <i>in the order of definition</i> in the
	 * backend configuration, as far as possible.
	 * @param type the class or interface to match, or {@code null} for all concrete beans
	 * @param includeNonSingletons whether to include prototype or scoped beans too
	 * or just singletons (also applies to FactoryBeans)
	 * @param allowEagerInit whether to initialize <i>lazy-init singletons</i> and
	 * <i>objects created by FactoryBeans</i> (or by factory methods with a
	 * "factory-bean" reference) for the type check. Note that FactoryBeans need to be
	 * eagerly initialized to determine their type: So be aware that passing in "true"
	 * for this flag will initialize FactoryBeans and "factory-bean" references.
	 * @return a Map with the matching beans, containing the bean names as
	 * keys and the corresponding bean instances as values
	 * @throws BeansException if a bean could not be created
	 * @see FactoryBean#getObjectType
	 * @see BeanFactoryUtils#beansOfTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)
	 */
	/**
	 *返回与给定对象类型匹配的bean实例（包括
	 *子类），从bean定义或
	 *在FactoryBean的情况下，｛@code getObjectType｝。
	 *＜p＞＜b＞注意：此方法仅内省顶级bean</b> 它不是</i>而是</i>
	 *检查可能与指定类型匹配的嵌套bean。
	 *＜p＞如果设置了“allowEagleInit”标志，则考虑FactoryBean创建的对象，
	 *这意味着FactoryBean将被初始化。如果由
	 *FactoryBean不匹配，原始FactoryBean本身将与
	 *类型。如果未设置“allowEagleInit”，则只检查原始FactoryBean
	 *（这不需要初始化每个FactoryBean）。
	 *＜p＞不考虑该工厂可能参与的任何层次结构。
	 *使用BeanFactoryUtils‘｛@code beansOfTypeInclusingAncestors｝
	 *将豆类也纳入祖先工厂。
	 *＜p＞注意：＜i＞是否＜/i＞忽略已注册的单例bean
	 *通过bean定义以外的其他方式。
	 *＜p＞此方法返回的Map应始终返回bean名称和
	 *在
	 *后端配置。
	 *@param键入要匹配的类或接口，或者｛@code null｝用于所有具体bean
	 *@param includeOnSingleton是否也包括原型或作用域bean
	 *或者仅仅是单体（也适用于FactoryBean）
	 *@param allowEagleInit是否初始化＜i＞lazy init singletons＜/i＞和
	 *<i>由FactoryBeans</i>创建的对象（或由带有
	 *“factorybean”引用）。注意FactoryBean需要
	 *急切地初始化以确定它们的类型：所以请注意传入“true”
	 *for此标志将初始化FactoryBean和“factorybean”引用。
	 *@返回带有匹配bean的Map，其中包含bean名称
	 *键和相应的bean实例作为值
	 *如果无法创建bean，@throws BeansException
	 *@参见FactoryBean#getObjectType
	 *@see BeanFactory Utils#beansOfTypeIncludedingAncestors（ListableBeanFactory，Class，boolean，boolean）
	 */
	<T> Map<String, T> getBeansOfType(@Nullable Class<T> type, boolean includeNonSingletons, boolean allowEagerInit)
			throws BeansException;

	/**
	 * Find all names of beans which are annotated with the supplied {@link Annotation}
	 * type, without creating corresponding bean instances yet.
	 * <p>Note that this method considers objects created by FactoryBeans, which means
	 * that FactoryBeans will get initialized in order to determine their object type.
	 * @param annotationType the type of annotation to look for
	 * (at class, interface or factory method level of the specified bean)
	 * @return the names of all matching beans
	 * @since 4.0
	 * @see #getBeansWithAnnotation(Class)
	 * @see #findAnnotationOnBean(String, Class)
	 */
	/**
	 *查找使用提供的｛@link Annotation｝注释的所有bean名称
	 *类型，而尚未创建相应的bean实例。
	 *＜p＞注意，此方法考虑FactoryBean创建的对象，这意味着
	 *FactoryBean将被初始化以确定其对象类型。
	 *@param annotation键入要查找的注释类型
	 *（在指定bean的类、接口或工厂方法级别）
	 *@返回所有匹配bean的名称
	 *@自4.0
	 *@参见#getBeanWithAnnotation（类）
	 *@参见#findAnnotationOnBean（字符串，类）
	 */
	String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType);

	/**
	 * Find all beans which are annotated with the supplied {@link Annotation} type,
	 * returning a Map of bean names with corresponding bean instances.
	 * <p>Note that this method considers objects created by FactoryBeans, which means
	 * that FactoryBeans will get initialized in order to determine their object type.
	 * @param annotationType the type of annotation to look for
	 * (at class, interface or factory method level of the specified bean)
	 * @return a Map with the matching beans, containing the bean names as
	 * keys and the corresponding bean instances as values
	 * @throws BeansException if a bean could not be created
	 * @since 3.0
	 * @see #findAnnotationOnBean(String, Class)
	 * @see #findAnnotationOnBean(String, Class, boolean)
	 * @see #findAllAnnotationsOnBean(String, Class, boolean)
	 */
	/**
	 *查找使用提供的｛@link Annotation｝类型注释的所有bean，
	 *返回带有相应bean实例的bean名称映射。
	 *＜p＞注意，此方法考虑FactoryBean创建的对象，这意味着
	 *FactoryBean将被初始化以确定其对象类型。
	 *@param annotation键入要查找的注释类型
	 *（在指定bean的类、接口或工厂方法级别）
	 *@返回带有匹配bean的Map，其中包含bean名称
	 *键和相应的bean实例作为值
	 *如果无法创建bean，@throws BeansException
	 *@自3.0
	 *@参见#findAnnotationOnBean（字符串，类）
	 *@see#findAnnotationOnBean（字符串、类、布尔值）
	 *@see#findAllAnnotationsOnBean（字符串、类、布尔值）
	 */
	Map<String, Object> getBeansWithAnnotation(Class<? extends Annotation> annotationType) throws BeansException;

	/**
	 * Find an {@link Annotation} of {@code annotationType} on the specified bean,
	 * traversing its interfaces and superclasses if no annotation can be found on
	 * the given class itself, as well as checking the bean's factory method (if any).
	 * @param beanName the name of the bean to look for annotations on
	 * @param annotationType the type of annotation to look for
	 * (at class, interface or factory method level of the specified bean)
	 * @return the annotation of the given type if found, or {@code null} otherwise
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @since 3.0
	 * @see #findAnnotationOnBean(String, Class, boolean)
	 * @see #findAllAnnotationsOnBean(String, Class, boolean)
	 * @see #getBeanNamesForAnnotation(Class)
	 * @see #getBeansWithAnnotation(Class)
	 * @see #getType(String)
	 */
	/**
	 *在指定的bean上查找｛@code annotationType｝的｛@link Annotation｝，
	 *如果在上找不到注释，则遍历其接口和超类
	 *给定类本身，以及检查bean的工厂方法（如果有的话）。
	 *@param beanName要在其上查找注释的bean的名称
	 *@param annotation键入要查找的注释类型
	 *（在指定bean的类、接口或工厂方法级别）
	 *如果找到，@返回给定类型的注释，否则返回｛@code null｝
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@自3.0
	 *@see#findAnnotationOnBean（字符串、类、布尔值）
	 *@see#findAllAnnotationsOnBean（字符串、类、布尔值）
	 *@参见#getBeanNameForAnnotation（类）
	 *@参见#getBeanWithAnnotation（类）
	 *@参见#getType（字符串）
	 */
	@Nullable
	<A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
			throws NoSuchBeanDefinitionException;

	/**
	 * Find an {@link Annotation} of {@code annotationType} on the specified bean,
	 * traversing its interfaces and superclasses if no annotation can be found on
	 * the given class itself, as well as checking the bean's factory method (if any).
	 * @param beanName the name of the bean to look for annotations on
	 * @param annotationType the type of annotation to look for
	 * (at class, interface or factory method level of the specified bean)
	 * @param allowFactoryBeanInit whether a {@code FactoryBean} may get initialized
	 * just for the purpose of determining its object type
	 * @return the annotation of the given type if found, or {@code null} otherwise
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @since 5.3.14
	 * @see #findAnnotationOnBean(String, Class)
	 * @see #findAllAnnotationsOnBean(String, Class, boolean)
	 * @see #getBeanNamesForAnnotation(Class)
	 * @see #getBeansWithAnnotation(Class)
	 * @see #getType(String, boolean)
	 */
	/**
	 *在指定的bean上查找｛@code annotationType｝的｛@link Annotation｝，
	 *如果在上找不到注释，则遍历其接口和超类
	 *给定类本身，以及检查bean的工厂方法（如果有的话）。
	 *@param beanName要在其上查找注释的bean的名称
	 *@param annotation键入要查找的注释类型
	 *（在指定bean的类、接口或工厂方法级别）
	 *@param allowFactoryBean检查｛@code FactoryBean｝是否可以初始化
	 *仅用于确定其对象类型
	 *如果找到，@返回给定类型的注释，否则返回｛@code null｝
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@自5.3.14
	 *@参见#findAnnotationOnBean（字符串，类）
	 *@see#findAllAnnotationsOnBean（字符串、类、布尔值）
	 *@参见#getBeanNameForAnnotation（类）
	 *@参见#getBeanWithAnnotation（类）
	 *@see#getType（字符串，布尔值）
	 */
	@Nullable
	<A extends Annotation> A findAnnotationOnBean(
			String beanName, Class<A> annotationType, boolean allowFactoryBeanInit)
			throws NoSuchBeanDefinitionException;

	/**
	 * Find all {@link Annotation} instances of {@code annotationType} on the specified
	 * bean, traversing its interfaces and superclasses if no annotation can be found on
	 * the given class itself, as well as checking the bean's factory method (if any).
	 * @param beanName the name of the bean to look for annotations on
	 * @param annotationType the type of annotation to look for
	 * (at class, interface or factory method level of the specified bean)
	 * @param allowFactoryBeanInit whether a {@code FactoryBean} may get initialized
	 * just for the purpose of determining its object type
	 * @return the set of annotations of the given type found (potentially empty)
	 * @throws NoSuchBeanDefinitionException if there is no bean with the given name
	 * @since 6.0
	 * @see #getBeanNamesForAnnotation(Class)
	 * @see #findAnnotationOnBean(String, Class, boolean)
	 * @see #getType(String, boolean)
	 */
	/**
	 *在指定的上查找｛@code annotationType｝的所有｛@link Annotation｝实例
	 *bean，如果在上找不到注释，则遍历其接口和超类
	 *给定类本身，以及检查bean的工厂方法（如果有的话）。
	 *@param beanName要在其上查找注释的bean的名称
	 *@param annotation键入要查找的注释类型
	 *（在指定bean的类、接口或工厂方法级别）
	 *@param allowFactoryBean检查｛@code FactoryBean｝是否可以初始化
	 *仅用于确定其对象类型
	 *@返回找到的给定类型的注释集（可能为空）
	 *如果没有具有给定名称的bean，@throws NoSuchBeanDefinitionException
	 *@自6.0起
	 *@参见#getBeanNameForAnnotation（类）
	 *@see#findAnnotationOnBean（字符串、类、布尔值）
	 *@see#getType（字符串，布尔值）
	 */
	<A extends Annotation> Set<A> findAllAnnotationsOnBean(
			String beanName, Class<A> annotationType, boolean allowFactoryBeanInit)
			throws NoSuchBeanDefinitionException;

}
